<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.5.1.js"></script>
</head>
<body>
    <div id="div1" style="width:80px;height:80px;background-color:red;"></div><br>
    <div id="div2" style="width:80px;height:80px;background-color:green;"></div><br>
    <div id="div3" style="width:80px;height:80px;background-color:blue;"></div><br>
    <button type="button" id="fadeIn">淡入</button>
    <button type="button" id="fadeOut">淡出</button>
    <button type="button" id="fadeInOrOut">淡入/淡出</button>
    <script type="text/javascript">
        $(function(){
            $("#fadeIn").click(function(){
                $("#div1").fadeIn( ) ;
                $("#div2").fadeIn("slow ") ;
                $("#div3").fadeIn( 3000 , function(){
                    console.log("回调函数执行了");
                }) ;
            }) ;

            $("#fadeOut").click(function(){
                $("#div1").fadeOut( ) ;
                $("#div2").fadeOut("slow" ) ;
                $("#div3").fadeOut( 3000 ) ;
            }) ;

            $("#fadeInOrOut").click(function() {
                $("#div1").fadeToggle(3000);
            });
        }) ;
    </script>
</body>
</html>